package com.cloudbroker.bcs.platform.dav.middle.dao;

import java.util.Date;
import java.util.List;

import com.cloudbroker.bcs.platform.dav.middle.dao.base.TenantDAOBase;
import com.cloudbroker.bcs.platform.dav.middle.entity.BrokerVote;

import com.cloudbroker.bcs.platform.dav.middle.entityexample.BrokerVoteQueryCondition;
import com.cloudbroker.bcs.platform.dav.middle.entityview.VoteRecordListView;
import org.apache.ibatis.annotations.Param;

/**
 * Created by Thinkpad on 2016/10/26.
 */
public interface BrokerVoteDAO extends TenantDAOBase<BrokerVote,Long>{
    List<BrokerVote> findByName(@Param("broker_name") String broker_name);

    List<BrokerVote> findAndSort(@Param("order_by") String order_by);

    void addVoteNum(@Param("broker_id") Long broker_id,@Param("tenant_id") Integer tenant_id,
                           @Param("vote_type") String vote_type,@Param("create_time")Date create_time);

    BrokerVote getVoteByBrokerId(@Param("broker_id") Long broker_id,@Param("vote_type") String vote_type);

    List<VoteRecordListView> getVoteRecordList(BrokerVoteQueryCondition condition);

    BrokerVote findByBorkerId(@Param("tenant_id") Integer tenant_id, @Param("broker_id") Long broker_id,@Param("vote_type") String vote_type);

    Date getLastVoteDate(@Param("tenant_id") Integer tenant_id,@Param("vote_type") String vote_type);
}
